package com.service.infoEntry.dao;

import com.service.config.utils.Result;
import com.service.infoEntry.entity.*;
import com.service.infoEntry.vo.RoleVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface TeamDao {

    boolean createTeam(TeamInfo teamInfo);

    Integer queryTeamByCreatorId(String creatorId);

    void addUser2Team(@Param("id") String id, @Param("teamId") String teamId,@Param("userId") String userId,@Param("userRole") int role,
                      @Param("addDate") Date nowDate, @Param("updateDate") Date nowDate1, @Param("adderId") String adderId, @Param("updderId") String adderId1);

    int findUserByTeamIdAndUserId(@Param("teamId") String teamId,@Param("userId") String userId);

    boolean removeUserFromTeam(@Param("teamId") String teamId, @Param("userId") String id);

    void addAdminInTeam(@Param("teamId") String teamId, @Param("userId") String id);

    void removeAdminInTeam(@Param("teamId") String teamId, @Param("userId") String id);

    Integer queryUserRole(@Param("userId") String userId, @Param("teamId") String teamId);

    List<TeamInfo> queryTeamsByUserId(@Param("userId") String userId);

    List<UserInfo> queryAllUserInTeam(@Param("teamId") String teamId);

    List<ProgrammeInfo> queryAllProgrammeInTeam(@Param("teamId") String teamId);

    void removeTeam(@Param("teamId") String teamId);

    void removeAllUserFromTeam(@Param("teamId") String teamId);

    Integer checkTeamIsExist(@Param("teamId") String teamId);

    Role queryRoleInTeam(@Param("userId") String userId, @Param("teamId") String teamId);

    List<Permission> queryPermissionsInTeam(@Param("teamId") String teamId, @Param("userId") String userId);

    TeamInfo queryTeamByTeamId(@Param("teamId") String teamId);

    void changeTeam(@Param("teamId") String teamId, @Param("userId") String userId);

    List<TeamInfo> queryAllTeam(TeamInfo teamInfo);
}
